const TokenKey = 'yuku_cash_app_token';
const userInfoKey = 'yuku_cash_app_userInfo';

export function getToken() {
	return uni.getStorageSync(TokenKey);
}

export function setToken(token) {
	return uni.setStorageSync(TokenKey, token);
}

export function removeToken() {
	return uni.removeStorageSync(TokenKey);
}

export function getUserInfo() {
	return uni.getStorageSync(userInfoKey) ? JSON.parse(uni.getStorageSync(userInfoKey)) : {};
}

export function setUserInfo(userInfo) {
	return uni.setStorageSync(userInfoKey, userInfo);
}

export function removeUserInfo() {
	return uni.removeStorageSync(userInfoKey);
}

export function getStatus() {
	return uni.getStorageSync('permissionStatus');
}

export function setStatus(status) {
	return uni.setStorageSync('permissionStatus', status);
}
export function removeStatus() {
	return uni.removeStorageSync('permissionStatus');
}

// 权限列表
export function getCodeList() {
	return uni.getStorageSync('CodeList');
}

export function setCodeList(CodeList) {
	return uni.setStorageSync('CodeList', CodeList);
}
export function removeCodeList() {
	return uni.removeStorageSync('CodeList');
}

// 权限名称列表
export function getNameList() {
	return uni.getStorageSync('NameList');
}

export function setNameList(NameList) {
	return uni.setStorageSync('NameList', NameList);
}
export function removeNameList() {
	return uni.removeStorageSync('NameList');
}
